const Router = require('koa-router')
const { Like } = require('../../models/like')
const { Auth } = require('../../core/middleware/auth')
const router = new Router({
    prefix: '/v1/like',
})
router.post('/setLike', new Auth().m, async (ctx, next) => {
    const obj = ctx.request.body
    const res = await Like.like(obj.id, ctx.auth.id)
    ctx.body = {
        code: 200,
        data: res
    }
})
module.exports = router
